package com.boarsoft.boar.entity;

import java.io.Serializable;

/**
 * 目录树<br/>
 * ，实体，部份对应dir_i表 完整目录树包括：部门?>>目录?>>应用>>目录?>>流程/模块
 * 
 * @author Mac_J
 *
 */
public class DirInfo implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = -5426843415007474095L;
	public static final short TYPE_DIR = 0; // 目录
	public static final short TYPE_APP = 1; // 应用
	public static final short TYPE_FLOW = 2; // 流程
	public static final short TYPE_COM = 3; // 组件
	public static final short TYPE_FILE = 4; // 文件
	public static final short TYPE_COMPANY = 5; // 公司
	public static final short TYPE_DEPT = 6; // 部门
	public static final short TYPE_FACE = 7; // 接口
	public static final short TYPE_LIB = 8; // 库
	public static final short TYPE_PROJ = 9; // 系统
	public static final short TYPE_SVC = 10;// 服务

	/** 不启用 */
	public static final short STATUS_NOUSE = 0;
	/** 启用 */
	public static final short STATUS_INUSE = 1;

	/** 不分享 */
	public static final short SHARE_NO = 0;
	/** 部门内分享 */
	public static final short SHARE_DEPARTMENT = 1;
	/** 公司内分享 */
	public static final short SHARE_COMPANY = 2;
	/** 完全公开 */
	public static final short SHARE_ALL = 3;
	/** 分享给指定人（凭密码查看） */
	public static final short SHARE_SOME = 4;

	/** ID */
	protected String id;
	/** 编号，对应目录名 */
	protected String code;
	/** 上级ID */
	protected String parentId;
	/** 目录中文名 */
	protected String name;
	/** 在树中的层级 */
	protected int level = 0;
	/** 子节点数 */
	protected int childCount;
	/** 状态 */
	protected short status = DirInfo.STATUS_INUSE;
	/** 路径，由逐级的code的组成 */
	protected String path;
	/** 目录类型 */
	private short type = DirInfo.TYPE_DIR;
	/** 目录描述 */
	protected String memo;

	public String toString() {
		return new StringBuilder().append(type).append("/").append(id).append("/").append(code).append("/").append(name)
				.toString();
	}

	public DirInfo() {
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getParentId() {
		return parentId;
	}

	public void setParentId(String parentId) {
		this.parentId = parentId;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getPath() {
		return path;
	}

	public void setPath(String path) {
		this.path = path;
	}

	public int getLevel() {
		return level;
	}

	public void setLevel(int level) {
		this.level = level;
	}

	public int getChildCount() {
		return childCount;
	}

	public void setChildCount(int childCount) {
		this.childCount = childCount;
	}

	public String getMemo() {
		return memo;
	}

	public void setMemo(String memo) {
		this.memo = memo;
	}

	public short getType() {
		return type;
	}

	public void setType(short type) {
		this.type = type;
	}

	public short getStatus() {
		return status;
	}

	public void setStatus(short status) {
		this.status = status;
	}
}
